﻿using DoNetDrive.Core;
using DoNetDrive.Core.Connector;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

namespace DoNetDrive.AspWebSocke.WebSocketClient
{
    public class WebSocketClientDetail : AbstractConnectorDetail
    {

        public IHeaderDictionary Headers { get; private set; }

        public QueryString QueryString { get; private set; }

        public Uri Uri { get; private set; }
        public string DeviceSn { get; set; }

        public bool  Connected { get; set; }
        public WebSocketClientDetail(string sn, string url)
        {
            DeviceSn = sn;
          //  ConnectAlias = sn;
            Uri = new Uri(url);
            Headers = new HeaderDictionary();
        }

        public override bool Equals(INConnectorDetail other)
        {
            if (other is not WebSocketClientDetail detail) return false;
            return detail.DeviceSn.Equals(DeviceSn);
        }

        public override string GetAssemblyName()
        {
            return "8280WebSocketServer.Sockt";
        }

        public override string GetKey()
        {
            return DeviceSn;
        }

        public override string GetTypeName()
        {
            return ConnectorType.WebSocketClient;
        }
    }
}
